ISCModelPropertyCollection

The ISCModelPropertyCollection interface is a collection of properties for a given model object. Membership in this collection can be limited by establishing filter criteria.

The following table contains the methods for the ISCModelPropertyCollection interface:

Method

Description

IUnknown _NewEnum()

Constructs an instance of the collection enumerator object.

ISCModelProperty * Add(VARIANT ClassId)

Construct a new property for a bound model object if it does not exist.

SC_CLSID * ClassIds()

Returns a SAFEARRAY of property class identifiers in the property collection.

Represents a value of the ModelProperties collection attribute that limited the membership at the time when this collection was created and can be used for reference purposes.

ClassIds contain an array of acceptable class identifiers (such as property classes). If this list is non-empty, the property collection includes only those properties whose class identifier appears on the list. If the list is empty or the caller supplies a NULL pointer, the collection includes all the properties owned by the object.

BSTR * ClassNames()

Same as the ClassIds property, but returns a SAFEARRAY of property type names in the property collection.

long Count()

Number of properties in the collection.

VARIANT_BOOL HasProperty(VARIANT ClassId, VARIANT MustBeOn [optional], VARIANT MustBeOff [optional])

Returns TRUE if the object owns a property of the passed class.

Treats properties as absent if they fail to satisfy ClassIds, MustBeOn, and MustBeOff attributes of the collection.

Alternative MustBeOn, MustBeOff can be offered using optional parameters.

VARIANT_BOOL HasPropertyFacets(VARIANT ClassId, VARIANT MustBeOn [optional], VARIANT MustBeOff [optional],

VARIANT FacetsMustBeSet [optional])

Returns TRUE if the object owns a property of the passed class.

Treats properties as absent if they fail to satisfy ClassIds, MustBeOn, and MustBeOff attributes of the collection.

Alternative FlagsMustBeOn, FlagsMustBeOff, FacetsMustBeSet can be offered using optional parameters.

FacetsMustBeSet indicates that a property must have one or more facets. The parameter can be either a SAFEARRAY of the facet's ID numbers, a SAFEARRAY of the facet's name strings, or a string with facet names separated by a semicolon.

ISCModelProperty * Item(VARIANT Class)

Returns a model object property.

The method checks if the property exists. If it does not, the method creates a property description, returns an ISCModelProperty instance, and sets the NULL flag for the property. A new property value can be set by using the Value property of the instance. However, it will fail to retrieve a value before it is set.

The method allows you to create an instance of ISCModelProperty for properties like ReadOnly, Maintained By the Tool, and so on. The value for these properties cannot be changed or assigned. Yet property flags, datatype, and so on are available even when the collection does not have the property instance. Use HasProperty to check on the existence of the property for a model object instance.

SC_ModelPropertyFlags MustBeOff()

Filter on property flags in the collection. The filter is set when the property collection is created through the ISCModelObject::CollectProperties method.

SC_ModelPropertyFlags MustBeOn()

Filter on property flags in the collection. The filter is set when the property collection is created through the ISCModelObject::CollectProperties method.

VARIANT_BOOL Remove(VARIANT ClassId)

Removes the indicated property from the bound object.

Successful execution of the call renders all binds with the removed property invalid. The client should release all ISCModelProperty pointers, and all related Value Collection and Value pointers known to represent such an association. Calls to interfaces fail and the IsValid method returns FALSE.

For information about valid property class identifiers and valid property class names, see the HTML document erwin Metamodel Reference, in the Metamodel Reference Bookshelf located in the erwin� Data Modeler installation folder. More information about SC_ModelPropertyFlags is located in the Enumerations section.